package main

import (
	"github.com/astaxie/beego"
	"github.com/astaxie/beego/plugins/cors"

	"stores/conf"
	"stores/models"
	_ "stores/routers"
)

func main() {
	conf.Init()
	models.Mysql_Init()
	beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
		AllowAllOrigins:  true,
		AllowOrigins:     []string{"*"},
		AllowCredentials: false,
		AllowMethods:     []string{"*"},
		AllowHeaders:     []string{"*"},
		ExposeHeaders:    []string{"*"},
		MaxAge:           0,
	}))
	beego.Run()
}
